package com.day.controller;

import com.day.pojo.Student;
import com.day.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/student")
public class StudentController {

    @Autowired
    private StudentService studentService;
    @RequestMapping("/getStudentList")
    public List<Student> getStudentList(){
      return studentService.getStudentList();
    }
    @RequestMapping("/getStudentById")
    public Student getStudentById(Integer stu_id){
        return studentService.getStudentById(stu_id);
    }
    @RequestMapping("/addStudent")
    public void addStudent(Student student){
        studentService.addStudent(student);
    }
    @RequestMapping("/delStudentById")
    public void delStudentById(Integer stu_id){
        studentService.delStudentById(stu_id);
    }
    @RequestMapping("/editStudentById")
    public void editStudentById(Student student){
        studentService.editStudentById(student);
    }
}
